package com.ezbuy.common.bean;

import com.ezbuy.common.helper.NameHelper;

/**
 * ezbuy 2018/12/1 下午5:41
 */
public class FieldType {
    public String name;
    public String type;
    public String singleType;
    public String inputMethod;
    public String outputMethod;
    public int entityType;//0默认，1自定义实体
    public int listType;//0默认，1列表

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        inputMethod = NameHelper.getSetMethod(name);
        outputMethod = NameHelper.getGetMethod(name);
    }

    public String getType() {
        return type;
    }

    public String getInputMethod() {
        return inputMethod;
    }

    public void setInputMethod(String inputMethod) {
        this.inputMethod = inputMethod;
    }

    public String getOutputMethod() {
        return outputMethod;
    }

    public void setOutputMethod(String outputMethod) {
        this.outputMethod = outputMethod;
    }

    public void setType(String type) {
        this.type = type;

    }

    public int getEntityType() {
        return entityType;
    }

    public void setEntityType(int entityType) {
        this.entityType = entityType;
    }

    public int getListType() {
        return listType;
    }

    public void setListType(int listType) {
        this.listType = listType;
        if(listType==1){
            inputMethod = NameHelper.getSetMethodList(name);
            outputMethod = NameHelper.getGetMethodList(name);
        }
    }

    public String getSingleType() {
        return singleType;
    }

    public void setSingleType(String singleType) {
        this.singleType = singleType;
    }

    @Override
    public String toString() {
        return "FieldType{" +
                "name='" + name + '\'' +
                ", type='" + type + '\'' +
                ", singleType='" + singleType + '\'' +
                ", inputMethod='" + inputMethod + '\'' +
                ", outputMethod='" + outputMethod + '\'' +
                ", entityType=" + entityType +
                ", listType=" + listType +
                '}';
    }
}
